package testDemo.Test9;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.ServerSocket;

public class Server{
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10066);
//        BufferedInputStream bis = new BufferedInputStream(ss.accept().getInputStream());
//        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("b.txt"));
//        byte[] bytes = new byte[1024];
//        int line;
//        while((line=bis.read(bytes))!=-1){
//            bos.write(bytes,0,line);
//            bos.flush();
//        }
        System.out.println(ss.accept().getInputStream().toString());
        ss.close();
    }
}
